<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<link href="<?php echo $this->baseUrl;?>/admincss/style.css" rel="stylesheet" type="text/css" />
<script charset="utf-8" src="<?php echo $this->baseUrl;?>/adminjs/kindeditor-min.js"></script>
<script charset="utf-8" src="<?php echo $this->baseUrl;?>/adminjs/lang/zh_CN.js"></script>
<script>
var editor;
KindEditor.ready(function(K) {
        editor = K.create('#content', {
		uploadJson : '<?php echo $this->url ($this->baseUrl, "article", "upload", "", "admin");?>',
		fileManagerJson : '<?php echo $this->url ($this->baseUrl, "article", "filemanage", "", "admin");?>',
		allowFileManager : true,
		urlType:"domain"
        });
});
</script>

<body>
<form id="form1" name="form1" method="post" enctype="multipart/form-data" action="<?php echo $this->url ($this->baseUrl, "image", "doadd", "", "admin");?>">
  <table width="100%" border="1" class="tableA" >
    <tr>
      <td colspan="3" align="center">添加图片</td>
    </tr>
    <tr>
      <td width="14%">名称</td>
      <td width="26%"><input name="name" type="text" id="name" size="30" /></td>
      <td width="60%">&nbsp;</td>
    </tr>
    <tr>
      <td width="14%">作者</td>
      <td width="26%"><input name="author" type="text" id="author" size="30" /></td>
      <td width="60%">&nbsp;</td>
    </tr>
    <tr>
      <td width="14%">图片</td>
      <td width="26%"><input name="image" type="file" id="image" size="30" onchange="javascript:return fileCheck();" /></td>
      <td width="60%">上传后自动压缩</td>
    </tr>
    <tr>
      <td>排序</td>
      <td><input name="seq" type="text" id="seq" value="100" size="10" /></td>
      <td>从大到小排序</td>
    </tr>
    <tr>
      <td>时间</td>
      <td colspan="2"><input name="pubtime" type="text" id="pubtime" value="" size="30" /></td>
    </tr>
        <tr>
      <td>内容</td>
      <td colspan="2">
      <textarea name="content" id="content" cols="80" rows="20" style="width:700px;height:400px;"></textarea></td>
    </tr>
    <tr>
      <td colspan="3" align="center"><input type="submit" name="button" id="button" value="提交" class="btn_submit"/></td>
    </tr>
  </table>
</form>
</body>
</html>
<script>
var d = new Date();
var today = d.getFullYear() + "-" +(d.getMonth()+1)+"-"+d.getDate()+ " "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();
document.getElementById('pubtime').value = today;
</script>
<script>
/**
 * 对所选择的文件类型加以判断
 */
function fileCheck(){
  var postfix = form1.image.value.match(/^(.*)(\.)(.{1,8})$/)[3].toLowerCase(); //获得选择的上传文件的后缀名的正则表达式
  if(!(postfix == "jpg"||postfix == "png"||postfix == "gif")) 
   { 
     alert('文件类型不正确，请选择jpg、png、gif文件 ！'); 
     var nf = form1.image.cloneNode(true); 
       nf.value=''; 
       form1.image.parentNode.replaceChild(nf, form1.image); 
     return false; 
   } 
}
</script>